home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Online / Apache / apache_1.3b3.diffs next >
Text File  |  1997-12-10  |  31KB  |  1,087 lines

  1. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/Configuration apache_1.3b3_amiga/src/Configuration
  2. *** apache_1.3b3/src/Configuration    Wed Nov 19 19:49:57 1997
  3. --- apache_1.3b3_amiga/src/Configuration    Thu Nov 27 21:21:00 1997
  4. ***************
  5. *** 42,46 ****
  6.   # the C compiler, looking for gcc first, then cc.
  7.   #
  8. ! EXTRA_CFLAGS=
  9.   EXTRA_LDFLAGS=
  10.   EXTRA_LIBS=
  11. --- 42,46 ----
  12.   # the C compiler, looking for gcc first, then cc.
  13.   #
  14. ! EXTRA_CFLAGS= -Dfork=ix_vfork -DSERVER_SUBVERSION=\"Amiga\"
  15.   EXTRA_LDFLAGS=
  16.   EXTRA_LIBS=
  17. ***************
  18. *** 116,120 ****
  19.   #  by OS specifics
  20.   
  21. ! Rule WANTHSREGEX=default
  22.   
  23.   ################################################################
  24. --- 116,120 ----
  25.   #  by OS specifics
  26.   
  27. ! Rule WANTHSREGEX=no
  28.   
  29.   ################################################################
  30. ***************
  31. *** 182,191 ****
  32.   ## full status information.  Check conf/access.conf on how to enable this.
  33.   
  34. ! # AddModule modules/standard/mod_status.o
  35.   
  36.   ## The Info module displays configuration information for the server and 
  37.   ## all included modules. It's very useful for debugging.
  38.   
  39. ! # AddModule         modules/standard/mod_info.o
  40.   
  41.   ## mod_include translates server-side include (SSI) statements in text files.
  42. --- 182,191 ----
  43.   ## full status information.  Check conf/access.conf on how to enable this.
  44.   
  45. ! AddModule modules/standard/mod_status.o
  46.   
  47.   ## The Info module displays configuration information for the server and
  48.   ## all included modules. It's very useful for debugging.
  49.   
  50. ! AddModule      modules/standard/mod_info.o
  51.   
  52.   ## mod_include translates server-side include (SSI) statements in text files.
  53. ***************
  54. *** 252,256 ****
  55.   ## password authentication.
  56.   
  57. ! # AddModule modules/standard/mod_auth_anon.o
  58.   
  59.   ## db_auth and dbm_auth work with Berkeley DB files - make sure there
  60. --- 252,256 ----
  61.   ## password authentication.
  62.   
  63. ! AddModule modules/standard/mod_auth_anon.o
  64.   
  65.   ## db_auth and dbm_auth work with Berkeley DB files - make sure there
  66. ***************
  67. *** 277,286 ****
  68.   ## as a function of access time or modification time.
  69.   
  70. ! # AddModule modules/standard/mod_expires.o
  71.   
  72.   ## The headers module can set arbitrary HTTP response headers,
  73.   ## as configured in server, vhost, access.conf or .htaccess configs
  74.   
  75. ! # AddModule modules/standard/mod_headers.o
  76.   
  77.   ## Miscellaneous modules
  78. --- 277,286 ----
  79.   ## as a function of access time or modification time.
  80.   
  81. ! AddModule modules/standard/mod_expires.o
  82.   
  83.   ## The headers module can set arbitrary HTTP response headers,
  84.   ## as configured in server, vhost, access.conf or .htaccess configs
  85.   
  86. ! AddModule modules/standard/mod_headers.o
  87.   
  88.   ## Miscellaneous modules
  89. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/Configure apache_1.3b3_amiga/src/Configure
  90. *** apache_1.3b3/src/Configure    Sat Nov 15 14:04:47 1997
  91. --- apache_1.3b3_amiga/src/Configure    Thu Nov 27 21:17:04 1997
  92. ***************
  93. *** 78,94 ****
  94.   # we bail out
  95.   #
  96. ! if egrep -v '^%?Module[     ]+[A-Za-z0-9_]+[     ]+[^     ]+$' $tmpfile \
  97. !  | egrep -v '^%?AddModule[     ]+[^     ]+$' \
  98. !  | grep -v = > /dev/null
  99. ! then
  100. !   echo "Syntax error --- The configuration file is used only to"
  101. !   echo "define the list of included modules or to set Makefile"
  102. !   echo "options or Configure rules, and I don't see that at all:"
  103. !   egrep -v '^%?Module[     ]+[A-Za-z0-9_]+[     ]+[^     ]+$' $tmpfile \
  104. !    | egrep -v '^%?AddModule[     ]+[^     ]+$'  \
  105. !    | grep -v =
  106. !   exitcode=1
  107. !   exit 1
  108. ! fi
  109.   
  110.   #
  111. --- 78,94 ----
  112.   # we bail out
  113.   #
  114. ! #if egrep -v '^%?Module[         ]+[A-Za-z0-9_]+[        ]+[^    ]+$' $tmpfile \
  115. ! # | egrep -v '^%?AddModule[      ]+[^    ]+$' \
  116. ! # | grep -v = > /dev/null
  117. ! #then
  118. ! #  echo "Syntax error --- The configuration file is used only to"
  119. ! #  echo "define the list of included modules or to set Makefile"
  120. ! #  echo "options or Configure rules, and I don't see that at all:"
  121. ! #  egrep -v '^%?Module[  ]+[A-Za-z0-9_]+[        ]+[^    ]+$' $tmpfile \
  122. ! #   | egrep -v '^%?AddModule[    ]+[^    ]+$'  \
  123. ! #   | grep -v =
  124. ! #  exitcode=1
  125. ! #  exit 1
  126. ! #fi
  127.   
  128.   #
  129. ***************
  130. *** 189,193 ****
  131.   
  132.   SHELL="/bin/sh"
  133. ! OSDIR="os/unix"
  134.   
  135.   case "$PLAT" in
  136. --- 189,193 ----
  137.   
  138.   SHELL="/bin/sh"
  139. ! OSDIR="os/amiga"
  140.   
  141.   case "$PLAT" in
  142. ***************
  143. *** 211,214 ****
  144. --- 211,220 ----
  145.       DEF_WANTHSREGEX=no
  146.       ;;
  147. +     *-*-AmigaOS*)
  148. +     OS='amigaos'
  149. +     CFLAGS="$CFLAGS -m68020 -resident -mstackextend -g"
  150. +     LFLAGS="$LFLAGS -m68020 -resident -g"
  151. +     DEF_WANTSHREGEX=no
  152. +     ;;
  153.       i386-ibm-aix*)
  154.       OS='IBM AIX PS/2'
  155. ***************
  156. *** 544,549 ****
  157.       echo uname -v
  158.       uname -v
  159. -     echo uname -X
  160. -     uname -X
  161.       echo Ideally, read the file PORTING, do what it says, and send the
  162.       echo resulting patches to The Apache Group by filling out a report
  163. --- 550,553 ----
  164. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/buildmark.c apache_1.3b3_amiga/src/buildmark.c
  165. *** apache_1.3b3/src/buildmark.c    Thu Nov 13 17:25:44 1997
  166. --- apache_1.3b3_amiga/src/buildmark.c    Tue Dec  2 21:58:04 1997
  167. ***************
  168. *** 1,5 ****
  169. --- 1,9 ----
  170.   #if defined(__DATE__) && defined(__TIME__)
  171. + #ifdef AMIGA
  172. + const char version[] = "$VER: Apache 1.3b1 " __DATE__ " " __TIME__ ;
  173. + #endif
  174.   const char SERVER_BUILT[] = __DATE__ " " __TIME__;
  175.   #else
  176.   const char SERVER_BUILT[] = "unknown";
  177.   #endif
  178. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/alloc.c apache_1.3b3_amiga/src/main/alloc.c
  179. *** apache_1.3b3/src/main/alloc.c    Wed Nov 12 18:22:05 1997
  180. --- apache_1.3b3_amiga/src/main/alloc.c    Sun Nov 30 18:42:09 1997
  181. ***************
  182. *** 1237,1243 ****
  183.   #endif
  184.   
  185. ! static int spawn_child_err_core(pool *p, int (*func) (void *), void *data,
  186. !                 enum kill_conditions kill_how,
  187. !                 int *pipe_in, int *pipe_out, int *pipe_err)
  188.   {
  189.       int pid;
  190. --- 1237,1252 ----
  191.   #endif
  192.   
  193. ! #ifdef AMIGA
  194. ! static pool *p;
  195. ! static void (*func)(void *);
  196. ! static void *data;
  197. ! static enum kill_conditions kill_how;
  198. ! static int *pipe_in, *pipe_out, *pipe_err;
  199. ! extern pool *pconf, *ptrans;
  200. ! extern server_rec *server_conf;
  201. ! #endif
  202. ! static int spawn_child_err_core(pool *_p, int (*_func) (void *), void *_data,
  203. !                 enum kill_conditions _kill_how,
  204. !                 int *_pipe_in, int *_pipe_out, int *_pipe_err)
  205.   {
  206.       int pid;
  207. ***************
  208. *** 1246,1249 ****
  209. --- 1255,1273 ----
  210.       int err_fds[2];
  211.       int save_errno;
  212. + #ifndef AMIGA
  213. +     pool *p;
  214. +     int (*func)(void *);
  215. +     void *data;
  216. +     enum kill_conditions kill_how;
  217. +     int *pipe_in, *pipe_out, *pipe_err;
  218. + #endif
  219. +     p = _p;
  220. +     func = _func;
  221. +     data = _data;
  222. +     kill_how = _kill_how;
  223. +     pipe_in = _pipe_in;
  224. +     pipe_out = _pipe_out;
  225. +     pipe_err = _pipe_err;
  226.   
  227.       if (pipe_in && os_pipe(in_fds) < 0) {
  228. ***************
  229. *** 1387,1390 ****
  230. --- 1411,1427 ----
  231.       }
  232.   
  233. + #ifdef AMIGA
  234. +     vfork_setup_child();
  235. +     init_alloc();
  236. +     pconf = permanent_pool;
  237. +     ptrans = make_sub_pool (pconf);
  238. + #if 0 /* It looks like I don't need these lines (for now) */
  239. +     server_conf = read_config(pconf, ptrans, server_confname);
  240. +     init_modules (pconf, server_conf);
  241. + #endif
  242. +     open_logs(server_conf, pconf);
  243. +     ix_vfork_resume();
  244. + #endif
  245.       /* HP-UX SIGCHLD fix goes here, if someone will remind me what it is... */
  246.       signal(SIGCHLD, SIG_DFL);       /* Was that it? */
  247. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/alloc.h apache_1.3b3_amiga/src/main/alloc.h
  248. *** apache_1.3b3/src/main/alloc.h    Wed Nov 12 18:22:06 1997
  249. --- apache_1.3b3_amiga/src/main/alloc.h    Thu Nov 27 19:29:35 1997
  250. ***************
  251. *** 74,77 ****
  252. --- 74,80 ----
  253.    */
  254.   
  255. + #ifndef ALLOC_H
  256. + #define ALLOC_H
  257.    /* Need declaration of DIR on Win32 */
  258.   #ifdef WIN32
  259. ***************
  260. *** 277,278 ****
  261. --- 280,283 ----
  262.   API_EXPORT(long) bytes_in_pool(pool *p);
  263.   API_EXPORT(long) bytes_in_free_blocks(void);
  264. + #endif
  265. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/conf.h apache_1.3b3_amiga/src/main/conf.h
  266. *** apache_1.3b3/src/main/conf.h    Sun Nov 16 10:43:15 1997
  267. --- apache_1.3b3_amiga/src/main/conf.h    Thu Dec  4 21:59:49 1997
  268. ***************
  269. *** 650,653 ****
  270. --- 650,665 ----
  271.   #define isascii(c)      (!((c) & ~0177))
  272.   
  273. + #elif defined(AMIGA)
  274. + #include <dos/var.h>
  275. + #include <proto/dos.h>
  276. + #define HAVE_SHMGET
  277. + #define HAVE_SYS_RESOURCE_H
  278. + #define HAVE_GMTOFF
  279. + #define USE_SYSVSEM_SERIALIZED_ACCEPT
  280. + #undef NO_KILLPG
  281. + #define NO_SETSID
  282. + #define JMP_BUF sigjmp_buf
  283. + #undef NO_LINGCLOSE
  284. + #define NO_SLACK
  285.   #elif defined(WIN32)
  286.   
  287. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/http_config.c apache_1.3b3_amiga/src/main/http_config.c
  288. *** apache_1.3b3/src/main/http_config.c    Thu Nov  6 15:40:42 1997
  289. --- apache_1.3b3_amiga/src/main/http_config.c    Thu Dec  4 20:59:41 1997
  290. ***************
  291. *** 877,881 ****
  292.       char *p;
  293.       int offset = (int) cmd->info;
  294. !     if (*arg == '/')
  295.       p = pstrdup(cmd->pool, arg);
  296.       else
  297. --- 877,881 ----
  298.       char *p;
  299.       int offset = (int) cmd->info;
  300. !     if (os_is_path_absolute(arg))
  301.       p = pstrdup(cmd->pool, arg);
  302.       else
  303. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/http_log.c apache_1.3b3_amiga/src/main/http_log.c
  304. *** apache_1.3b3/src/main/http_log.c    Thu Nov  6 16:54:08 1997
  305. --- apache_1.3b3_amiga/src/main/http_log.c    Thu Nov 27 20:47:12 1997
  306. ***************
  307. *** 408,412 ****
  308. --- 408,416 ----
  309.   
  310.       block_alarms();
  311. + #ifdef AMIGA
  312. +     pid = vfork();
  313. + #else
  314.       pid = fork();
  315. + #endif
  316.       if (pid == 0) {
  317.       /* XXX: this needs porting to OS2 and WIN32 */
  318. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/http_main.c apache_1.3b3_amiga/src/main/http_main.c
  319. *** apache_1.3b3/src/main/http_main.c    Sun Nov 16 10:43:16 1997
  320. --- apache_1.3b3_amiga/src/main/http_main.c    Thu Dec  4 21:59:33 1997
  321. ***************
  322. *** 93,96 ****
  323. --- 93,101 ----
  324.   #include <sys/ipc.h>
  325.   #include <sys/shm.h>
  326. + #ifdef AMIGA
  327. + #define SHM_R IPC_R
  328. + #define SHM_W IPC_W
  329. + #define SHM_M IPC_M
  330. + #endif
  331.   #endif
  332.   #ifdef SecureWare
  333. ***************
  334. *** 105,108 ****
  335. --- 110,117 ----
  336.   #endif
  337.   
  338. + #ifdef AMIGA
  339. + #include <dos/dosextens.h>
  340. + #endif
  341.   #ifdef HAVE_BSTRING_H
  342.   #include <bstring.h>        /* for IRIX, FD_SET calls bzero() */
  343. ***************
  344. *** 241,247 ****
  345.   #endif
  346.   
  347. ! static pool *pconf;        /* Pool for config stuff */
  348. ! static pool *ptrans;        /* Pool for per-transaction stuff */
  349. ! static pool *pchild;        /* Pool for httpd child stuff */
  350.   
  351.   int APACHE_TLS my_pid;        /* it seems silly to call getpid all the time */
  352. --- 250,256 ----
  353.   #endif
  354.   
  355. ! pool *pconf;         /* Pool for config stuff */
  356. ! pool *ptrans;         /* Pool for per-transaction stuff */
  357. ! pool *pchild;         /* Pool for httpd child stuff */
  358.   
  359.   int APACHE_TLS my_pid;        /* it seems silly to call getpid all the time */
  360. ***************
  361. *** 663,667 ****
  362.       }
  363.   }
  364.   #else
  365.   /* Default --- no serialization.  Other methods *could* go here,
  366. --- 672,675 ----
  367. ***************
  368. *** 1816,1819 ****
  369. --- 1824,1830 ----
  370.                   pid);
  371.           kill(pid, SIGHUP);
  372. + #ifdef AMIGA  /* On the amiga, a waitpid is needed to fully cleanup the resources (ie CLI entry) */
  373. +          waitpid(pid, NULL, WNOHANG);
  374. + #endif
  375.           waittime = 1024 * 16;
  376.           break;
  377. ***************
  378. *** 1829,1832 ****
  379. --- 1840,1846 ----
  380.                   pid);
  381.           kill(pid, SIGTERM);
  382. + #ifdef AMIGA  /* On the amiga, a waitpid is needed to fully cleanup the resources (ie CLI entry) */
  383. +         waitpid(pid, NULL, WNOHANG);
  384. + #endif
  385.           break;
  386.           case 8:    /*  6 sec */
  387. ***************
  388. *** 1836,1839 ****
  389. --- 1850,1856 ----
  390.                   pid);
  391.           kill(pid, SIGKILL);
  392. + #ifdef AMIGA  /* On the amiga, a waitpid is needed to fully cleanup the resources (ie CLI entry) */
  393. +         waitpid(pid, NULL, WNOHANG);
  394. + #endif
  395.           break;
  396.           case 9:    /* 14 sec */
  397. ***************
  398. *** 2015,2018 ****
  399. --- 2032,2038 ----
  400.       aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, emsg);
  401.       chdir(coredump_dir);
  402. + #ifdef AMIGA /* Alas, the amiga doesn't support process groups */
  403. +     reclaim_child_processes(1);
  404. + #endif
  405.       abort();
  406.       exit(1);
  407. ***************
  408. *** 2092,2100 ****
  409. --- 2112,2128 ----
  410.           aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGABRT)");
  411.   #endif
  412.       }
  413.       sa.sa_handler = sig_term;
  414.       if (sigaction(SIGTERM, &sa, NULL) < 0)
  415.       aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGTERM)");
  416.   
  417. + #ifdef AMIGA
  418. +     if (sigaction(SIGINT, &sa, NULL) < 0)
  419. +     aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGTERM)");
  420. + #endif
  421.       /* we want to ignore HUPs and USR1 while we're busy processing one */
  422.       sigaddset(&sa.sa_mask, SIGHUP);
  423. ***************
  424. *** 2119,2122 ****
  425. --- 2147,2154 ----
  426.       }
  427.   
  428. + #ifdef AMIGA
  429. +        signal(SIGINT, sig_term);
  430. + #endif
  431.       signal(SIGTERM, sig_term);
  432.   #ifdef SIGHUP
  433. ***************
  434. *** 2139,2142 ****
  435. --- 2171,2175 ----
  436.       int x;
  437.   
  438. + #ifndef AMIGA
  439.       chdir("/");
  440.   #ifndef MPE
  441. ***************
  442. *** 2152,2155 ****
  443. --- 2185,2190 ----
  444.       RAISE_SIGSTOP(DETACH);
  445.   #endif
  446. + #endif
  447.   #ifndef NO_SETSID
  448.       if ((pgrp = setsid()) == -1) {
  449. ***************
  450. *** 2252,2258 ****
  451. --- 2287,2295 ----
  452.   #endif
  453.       if (setgid(group_id) == -1) {
  454. + #ifndef AMIGA /* this may fail since MuFS doesn't support it */
  455.           aplog_error(APLOG_MARK, APLOG_ALERT, server_conf,
  456.               "setgid: unable to set group id");
  457.           exit(1);
  458. + #endif
  459.       }
  460.   #endif
  461. ***************
  462. *** 3026,3032 ****
  463.   }
  464.   
  465. ! static int make_child(server_rec *s, int slot, time_t now)
  466.   {
  467.       int pid;
  468.   
  469.       if (slot + 1 > max_daemons_limit) {
  470. --- 3063,3083 ----
  471.   }
  472.   
  473. ! #ifdef AMIGA
  474. ! static server_rec *s;
  475. ! static int slot;
  476. ! time_t now;
  477. ! #endif
  478. ! static int make_child(server_rec *_s, int _slot, time_t _now)
  479.   {
  480.       int pid;
  481. + #ifndef AMIGA
  482. +     server_rec *s;
  483. +     int _slot;
  484. +     time_t now;
  485. + #endif
  486. +     s = _s;
  487. +     slot = _slot;
  488. +     now = _now;
  489.   
  490.       if (slot + 1 > max_daemons_limit) {
  491. ***************
  492. *** 3063,3066 ****
  493. --- 3114,3127 ----
  494.   
  495.       if (!pid) {
  496. + #ifdef AMIGA
  497. +     vfork_setup_child();
  498. +     init_alloc();
  499. +     pconf = permanent_pool;
  500. +     ptrans = make_sub_pool (pconf);
  501. +     server_conf = s = read_config(pconf, ptrans, server_confname);
  502. +     init_modules (pconf, server_conf);
  503. +     open_logs(server_conf, pconf);
  504. +     ix_vfork_resume();
  505. + #endif
  506.       RAISE_SIGSTOP(MAKE_CHILD);
  507.       /* Disable the restart signal handlers and enable the just_die stuff.
  508. ***************
  509. *** 3622,3628 ****
  510. --- 3683,3702 ----
  511.           process_request(r);
  512.       }
  513. + #ifdef NO_LINGCLOSE
  514. +     bclose(cio);        /* just close it */
  515. + #else
  516. +     if (r &&  r->connection
  517. +           && !r->connection->aborted
  518. +           &&  r->connection->client
  519. +           && (r->connection->client->fd >= 0)) {
  520.   
  521. +         lingering_close(r);
  522. +     }
  523. +     else {
  524. +         bsetflag(cio, B_EOUT, 1);
  525.       bclose(cio);
  526.       }
  527. + #endif
  528. +     }
  529.       exit(0);
  530.   }
  531. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/http_request.c apache_1.3b3_amiga/src/main/http_request.c
  532. *** apache_1.3b3/src/main/http_request.c    Fri Nov 14 22:29:57 1997
  533. --- apache_1.3b3_amiga/src/main/http_request.c    Tue Dec  2 20:51:42 1997
  534. ***************
  535. *** 210,214 ****
  536. --- 210,220 ----
  537.       }
  538.   #if defined(ENOENT) && defined(ENOTDIR)
  539. + #ifdef AMIGA /* stat is broken, it returns EINVAL for /foo/bar where
  540. +           * /foo exists and is a file
  541. +           */
  542. +      else if (errno == ENOENT || errno == ENOTDIR || errno == EINVAL) {
  543. + #else
  544.        else if (errno == ENOENT || errno == ENOTDIR) {
  545. + #endif
  546.           last_cp = cp;
  547.   
  548. ***************
  549. *** 304,307 ****
  550. --- 310,315 ----
  551.       /* Add OS/2 drive name support */
  552.       if ((test_filename[0] != '/') && (test_filename[1] != ':'))
  553. + #elif AMIGA
  554. +     if (test_filename[0] != '/' && !strchr(test_filename, ':'))
  555.   #else
  556.       if (test_filename[0] != '/')
  557. ***************
  558. *** 413,416 ****
  559. --- 421,426 ----
  560.   #if defined(__EMX__) || defined(WIN32)
  561.           || (entry_dir[0] != '/' && entry_dir[1] != ':')
  562. + #elif AMIGA
  563. +         || (entry_dir[0] != '/' && !strchr(entry_dir, ':'))
  564.   #else
  565.           || entry_dir[0] != '/'
  566. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/httpd.h apache_1.3b3_amiga/src/main/httpd.h
  567. *** apache_1.3b3/src/main/httpd.h    Wed Nov 19 19:37:25 1997
  568. --- apache_1.3b3_amiga/src/main/httpd.h    Thu Nov 27 19:50:36 1997
  569. ***************
  570. *** 71,75 ****
  571.   /* Set default for OS/2 file system */
  572.   #define HTTPD_ROOT "/os2httpd"
  573. ! #elif defined(WIN32)
  574.   /* Set default for Windows file system */
  575.   #define HTTPD_ROOT "/apache"
  576. --- 71,75 ----
  577.   /* Set default for OS/2 file system */
  578.   #define HTTPD_ROOT "/os2httpd"
  579. ! #elif defined(WIN32) || defined(AMIGA)
  580.   /* Set default for Windows file system */
  581.   #define HTTPD_ROOT "/apache"
  582. ***************
  583. *** 84,87 ****
  584. --- 84,89 ----
  585.   /* Set default for OS/2 file system */
  586.   #define DOCUMENT_LOCATION "/os2httpd/docs"
  587. + #elif defined(AMIGA)
  588. + #define DOCUMENT_LOCATION "/apache/htdocs"
  589.   #else
  590.   #define DOCUMENT_LOCATION "/usr/local/apache/htdocs"
  591. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/util.c apache_1.3b3_amiga/src/main/util.c
  592. *** apache_1.3b3/src/main/util.c    Thu Nov 13 12:05:15 1997
  593. --- apache_1.3b3_amiga/src/main/util.c    Thu Dec  4 20:24:05 1997
  594. ***************
  595. *** 394,401 ****
  596. --- 394,408 ----
  597.       *d = *s;
  598.       if (*d == '\0') {
  599. + #ifdef AMIGA
  600. +         if (*(d-1) != ':')
  601. + #endif
  602.           *d = '/';
  603.           break;
  604.       }
  605. + #ifdef AMIGA
  606. +     if ((*d == '/' || *d == ':') && (--n) == 0)
  607. + #else
  608.       if (*d == '/' && (--n) == 0)
  609. + #endif
  610.           break;
  611.       ++d;
  612. ***************
  613. *** 416,420 ****
  614.       int l;
  615.   
  616. !     if (last_slash == NULL) {
  617.       /* XXX: well this is really broken if this happens */
  618.       return (pstrdup(p, "/"));
  619. --- 423,432 ----
  620.       int l;
  621.   
  622. ! #ifdef AMIGA
  623. !     if (last_slash == NULL && (last_slash = strchr(s, ':')) == NULL)
  624. ! #else
  625. !     if (last_slash == NULL)
  626. ! #endif
  627. !     {
  628.       /* XXX: well this is really broken if this happens */
  629.       return (pstrdup(p, "/"));
  630. ***************
  631. *** 438,445 ****
  632. --- 450,466 ----
  633.   
  634.       for (x = 0, f = 0; s[x]; x++) {
  635. + #ifdef AMIGA /* Beware the dreaded ':' */
  636. +      if (s[x] == '/' || (x && s[x-1] == ':'))
  637. + #else
  638.        if(s[x] == '/')
  639. + #endif
  640.           if ((++f) == n) {
  641.           res = palloc(p, x + 2);
  642.           strncpy(res, s, x);
  643. + #ifdef AMIGA
  644. +         if (res[x-1] == ':')
  645. +            x--;
  646. +         else
  647. + #endif
  648.           res[x] = '/';
  649.           res[x + 1] = '\0';
  650. ***************
  651. *** 458,464 ****
  652.       register int x, n;
  653.   
  654. !     for (x = 0, n = 0; path[x]; x++)
  655.       if (path[x] == '/')
  656.           n++;
  657.       return n;
  658.   }
  659. --- 479,490 ----
  660.       register int x, n;
  661.   
  662. !     for (x = 0, n = 0; path[x]; x++)  {
  663. ! #ifdef AMIGA /* Beware the dreaded ':' */
  664. !     if(path[x] == ':')
  665. !         n++;
  666. ! #endif
  667.       if (path[x] == '/')
  668.           n++;
  669. +     }
  670.       return n;
  671.   }
  672. ***************
  673. *** 471,475 ****
  674.   
  675.       x = strrchr(file, '/');
  676. !     if (x == NULL) {
  677.       chdir(file);
  678.       }
  679. --- 497,506 ----
  680.   
  681.       x = strrchr(file, '/');
  682. ! #ifdef AMIGA
  683. !     if (x == NULL && (x = strchr(file, ':')) == NULL)
  684. ! #else
  685. !     if (x == NULL)
  686. ! #endif
  687. !     {
  688.       chdir(file);
  689.       }
  690. ***************
  691. *** 1172,1176 ****
  692. --- 1203,1211 ----
  693.       return pstrcat(a, "/", src2, NULL);
  694.   
  695. + #ifdef AMIGA /* Beware the dreaded ':' */
  696. +      if ( (src1[x - 1] != '/') && (src1[x - 1] != ':') )
  697. + #else
  698.        if (src1[x - 1] != '/')
  699. + #endif
  700.       return pstrcat(a, src1, "/", src2, NULL);
  701.       else
  702. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/main/util_script.c apache_1.3b3_amiga/src/main/util_script.c
  703. *** apache_1.3b3/src/main/util_script.c    Sun Nov 16 10:45:22 1997
  704. --- apache_1.3b3_amiga/src/main/util_script.c    Thu Nov 27 20:42:09 1997
  705. ***************
  706. *** 349,352 ****
  707. --- 349,356 ----
  708.   #endif
  709.       }
  710. + #if 0
  711. +     destroy_sub_req(r);
  712. + #endif
  713.       }
  714.   }
  715. ***************
  716. *** 779,782 ****
  717. --- 783,811 ----
  718.       }
  719.   #else
  720. + #ifdef AMIGA
  721. +     /* Not all programs are compiled to use ixemul.library
  722. +      * Their local variables are passed using GetVar, SetVar
  723. +      * So I must also pass it to them this way
  724. +      */
  725. +     if (env) {
  726. +     char *envvar;
  727. +     char *equal;
  728. +     char *value;
  729. +     int i;
  730. +     for (i = 0; env[i] != (char *)0; i++) {
  731. +         envvar = env[i];
  732. +         equal = strchr(envvar, '=');
  733. +         if (equal) {
  734. +         char variable[equal-envvar+1];
  735. +         variable[equal-envvar] = '\0';
  736. +         strncpy(variable,envvar, equal-envvar);
  737. +         value = equal+1;
  738. +         SetVar(variable, value, -1, GVF_LOCAL_ONLY);
  739. +         }
  740. +     }
  741. +     }
  742. + #endif
  743.       if (suexec_enabled &&
  744.       ((r->server->server_uid != user_id) ||
  745. ***************
  746. *** 844,847 ****
  747. --- 873,927 ----
  748.       }
  749.       }
  750. + #ifdef AMIGA /* allow ARexx scripts to be run */
  751. +     else {
  752. +        if (shellcmd)
  753. +        execle(SHELL_PATH, SHELL_PATH, "-c", argv0, NULL, env);
  754. +        else {
  755. +        FILE *rxfile;
  756. +        int isrexx = 0;
  757. +        char err_string[512];
  758. +        int chr, chr2;
  759. +        rxfile = fopen(r->filename, "r");
  760. +        if (!rxfile) {
  761. +            return;
  762. +        }
  763. +        /* skip the leading white space */
  764. +        while(isspace((chr=fgetc(rxfile))))
  765. +            ;
  766. +        /* all ARexx files start with comment header */
  767. +        if (chr == '/' && (chr2 = fgetc(rxfile)) == '*') {
  768. +            isrexx = 1;
  769. +        }
  770. +        fclose(rxfile);
  771. +        if((!r->args) || (!r->args[0]) || (ind(r->args,'=') >= 0)) {
  772. +            if (isrexx) {
  773. +           execle("/apache/cgi-bin/rx-gate", argv0, NULL, env);
  774. +            }
  775. +            else {
  776. +            execle(r->filename, argv0, NULL, env);
  777. +            }
  778. +        }
  779. +        else  {
  780. +            if (isrexx) {
  781. +           execve("/apache/cgi-bin/rx-gate",
  782. +             create_argv(r->pool, NULL, NULL, NULL, argv0, r->args),
  783. +             env);
  784. +            }
  785. +            else {
  786. +           execve(r->filename,
  787. +             create_argv(r->pool, NULL, NULL, NULL, argv0, r->args),
  788. +             env);
  789. +            }
  790. +        }
  791. +        }
  792. +      }
  793. + #else
  794.       else {
  795.       if (shellcmd)
  796. ***************
  797. *** 857,860 ****
  798. --- 937,941 ----
  799.       }
  800.       return (pid);
  801. + #endif
  802.   #endif
  803.   }
  804. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/modules/standard/mod_auth.c apache_1.3b3_amiga/src/modules/standard/mod_auth.c
  805. *** apache_1.3b3/src/modules/standard/mod_auth.c    Sun Oct 26 15:20:03 1997
  806. --- apache_1.3b3_amiga/src/modules/standard/mod_auth.c    Thu Nov 27 21:07:42 1997
  807. ***************
  808. *** 200,203 ****
  809. --- 200,207 ----
  810.       char *sent_pw, *real_pw;
  811.       int res;
  812. + #ifdef AMIGA
  813. +     char another_pw[24]={0,}, *crypted_pw;
  814. +     char salt[3];
  815. + #endif
  816.   
  817.       if ((res = get_basic_auth_pw(r, &sent_pw)))
  818. ***************
  819. *** 216,220 ****
  820.       }
  821.       /* anyone know where the prototype for crypt is? */
  822. !     if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) {
  823.       aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server,
  824.               "user %s: password mismatch: %s", c->user, r->uri);
  825. --- 220,236 ----
  826.       }
  827.       /* anyone know where the prototype for crypt is? */
  828. ! #ifdef AMIGA
  829. !     salt[0] = real_pw[0];
  830. !     salt[1] = real_pw[1];
  831. !     salt[2] = '\0';
  832. !     /* if MuFS is installed, crypt will return NULL */
  833. !     crypted_pw = crypt(sent_pw, salt);
  834. !     if (crypted_pw == NULL)
  835. !     ACrypt(another_pw, sent_pw, c->user);
  836. !     if ( (crypted_pw == NULL && strcmp(real_pw, another_pw)) || (crypted_pw && strcmp(real_pw, crypted_pw)))
  837. ! #else
  838. !     if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw)))
  839. ! #endif
  840. !     {
  841.       aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server,
  842.               "user %s: password mismatch: %s", c->user, r->uri);
  843. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/modules/standard/mod_auth_db.c apache_1.3b3_amiga/src/modules/standard/mod_auth_db.c
  844. *** apache_1.3b3/src/modules/standard/mod_auth_db.c    Wed Oct 22 16:30:15 1997
  845. --- apache_1.3b3_amiga/src/modules/standard/mod_auth_db.c    Thu Nov 27 21:08:35 1997
  846. ***************
  847. *** 199,202 ****
  848. --- 199,206 ----
  849.       char *sent_pw, *real_pw, *colon_pw;
  850.       int res;
  851. + #ifdef AMIGA
  852. +     char another_pw[24]={0,}, *crypted_pw;
  853. +     char salt[3];
  854. + #endif
  855.   
  856.       if ((res = get_basic_auth_pw(r, &sent_pw)))
  857. ***************
  858. *** 219,223 ****
  859.       *colon_pw = '\0';
  860.       /* anyone know where the prototype for crypt is? */
  861. !     if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) {
  862.       aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server,
  863.               "DB user %s: password mismatch: %s", c->user, r->uri);
  864. --- 223,239 ----
  865.       *colon_pw = '\0';
  866.       /* anyone know where the prototype for crypt is? */
  867. !     /* anyone know where the prototype for crypt is? */
  868. ! #ifdef AMIGA
  869. !     salt[0] = real_pw[0];
  870. !     salt[1] = real_pw[1];
  871. !     salt[2] = '\0';
  872. !     crypted_pw = crypt(sent_pw, salt);
  873. !     if (crypted_pw == NULL)
  874. !     ACrypt(another_pw, sent_pw, c->user);
  875. !     if ( (crypted_pw == NULL && strcmp(real_pw, another_pw)) || (crypted_pw && strcmp(real_pw, crypted_pw)))
  876. ! #else
  877. !     if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw)))
  878. ! #endif
  879. !     {
  880.       aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server,
  881.               "DB user %s: password mismatch: %s", c->user, r->uri);
  882. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/modules/standard/mod_auth_dbm.c apache_1.3b3_amiga/src/modules/standard/mod_auth_dbm.c
  883. *** apache_1.3b3/src/modules/standard/mod_auth_dbm.c    Wed Oct 22 16:30:16 1997
  884. --- apache_1.3b3_amiga/src/modules/standard/mod_auth_dbm.c    Thu Nov 27 20:04:26 1997
  885. ***************
  886. *** 223,226 ****
  887. --- 223,230 ----
  888.       char *sent_pw, *real_pw, *colon_pw;
  889.       int res;
  890. + #ifdef AMIGA
  891. +    char another_pw[24]={0,}, *crypted_pw;
  892. +    char salt[3];
  893. + #endif
  894.   
  895.       if ((res = get_basic_auth_pw(r, &sent_pw)))
  896. ***************
  897. *** 243,247 ****
  898. --- 247,261 ----
  899.       *colon_pw = '\0';
  900.       /* anyone know where the prototype for crypt is? */
  901. + #ifdef AMIGA
  902. +     salt[0] = real_pw[0];
  903. +     salt[1] = real_pw[1];
  904. +     salt[2] = '\0';
  905. +     crypted_pw = crypt(sent_pw, salt);
  906. +     if (crypted_pw == NULL)
  907. +     ACrypt(another_pw, sent_pw, c->user);
  908. +     if ( (crypted_pw == NULL && strcmp(real_pw, another_pw)) || (crypted_pw && strcmp(real_pw, crypted_pw)))
  909. + #else
  910.       if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) {
  911. + #endif
  912.       aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server,
  913.               "user %s: password mismatch: %s", c->user, r->uri);
  914. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/modules/standard/mod_autoindex.c apache_1.3b3_amiga/src/modules/standard/mod_autoindex.c
  915. *** apache_1.3b3/src/modules/standard/mod_autoindex.c    Wed Nov 12 16:37:45 1997
  916. --- apache_1.3b3_amiga/src/modules/standard/mod_autoindex.c    Tue Dec  2 21:30:08 1997
  917. ***************
  918. *** 126,129 ****
  919. --- 126,136 ----
  920.   } autoindex_config_rec;
  921.   
  922. + #ifdef AMIGA
  923. + /* the addresses change when the children are forked so this is flawed */
  924. + /* I think this is a back hack too! */
  925. + #define BY_ENCODING (char *)0x01234567
  926. + #define BY_PATH     (char *)0x98765432
  927. + #define BY_TYPE     (char *)0x90ABCDEF
  928. + #else
  929.   static char c_by_encoding, c_by_type, c_by_path;
  930.   
  931. ***************
  932. *** 131,134 ****
  933. --- 138,142 ----
  934.   #define BY_TYPE &c_by_type
  935.   #define BY_PATH &c_by_path
  936. + #endif
  937.   
  938.   /*
  939. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/modules/standard/mod_userdir.c apache_1.3b3_amiga/src/modules/standard/mod_userdir.c
  940. *** apache_1.3b3/src/modules/standard/mod_userdir.c    Wed Oct 22 16:30:31 1997
  941. --- apache_1.3b3_amiga/src/modules/standard/mod_userdir.c    Thu Nov 27 20:06:39 1997
  942. ***************
  943. *** 302,305 ****
  944. --- 302,311 ----
  945.           /* Need to manually add user name for OS/2 */
  946.           filename = pstrcat(r->pool, pw->pw_dir, w, "/", userdir, NULL);
  947. + #elif AMIGA
  948. +         char *plce = strchr(pw->pw_dir,'\0');
  949. +         if (plce[-1] != '/' && plce[-1] != ':')
  950. +             filename = pstrcat (r->pool, pw->pw_dir, "/", userdir, NULL);
  951. +         else
  952. +             filename = pstrcat (r->pool, pw->pw_dir, userdir, NULL);
  953.   #else
  954.           filename = pstrcat(r->pool, pw->pw_dir, "/", userdir, NULL);
  955. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/os/amiga/Makefile.tmpl apache_1.3b3_amiga/src/os/amiga/Makefile.tmpl
  956. *** apache_1.3b3/src/os/amiga/Makefile.tmpl    Wed Dec 31 19:00:00 1969
  957. --- apache_1.3b3_amiga/src/os/amiga/Makefile.tmpl    Tue Oct  7 15:53:32 1997
  958. ***************
  959. *** 0 ****
  960. --- 1,27 ----
  961. + CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  962. + LIBS=$(EXTRA_LIBS) $(LIBS1)
  963. + INCLUDES=$(INCLUDES1) $(INCLUDES_DEPTH2) $(EXTRA_INCLUDES)
  964. + LFLAGS=$(LFLAGS1) $(EXTRA_LFLAGS)
  965. + INCDIR=../../main
  966. + OBJS=    os.o os-inline.o
  967. + LIB=    libos.a
  968. + all:    $(LIB)
  969. + $(LIB): $(OBJS)
  970. +     rm -f $@
  971. +     ar cr $@ $(OBJS)
  972. +     $(RANLIB) $@
  973. + .c.o:
  974. +     $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<
  975. + clean:
  976. +     rm -f $(OBJS) $(LIB)
  977. + $(OBJS): Makefile
  978. + # DO NOT REMOVE
  979. + os.o:    os.c os-inline.c
  980. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/os/amiga/os-inline.c apache_1.3b3_amiga/src/os/amiga/os-inline.c
  981. *** apache_1.3b3/src/os/amiga/os-inline.c    Wed Dec 31 19:00:00 1969
  982. --- apache_1.3b3_amiga/src/os/amiga/os-inline.c    Thu Nov 27 19:36:00 1997
  983. ***************
  984. *** 0 ****
  985. --- 1,30 ----
  986. + /*
  987. +  * This file contains functions which can be inlined if the compiler
  988. +  * has an "inline" modifier. Because of this, this file is both a
  989. +  * header file and a compilable module.
  990. +  *
  991. +  * Only inlineable functions should be defined in here. They must all
  992. +  * include the INLINE modifier.
  993. +  *
  994. +  * If the compiler supports inline, this file will be #included as a
  995. +  * header file from os.h to create all the inline function
  996. +  * definitions. INLINE will be defined to whatever is required on
  997. +  * function definitions to make them inline declarations.
  998. +  *
  999. +  * If the compiler does not support inline, this file will be compiled
  1000. +  * as a normal C file into libos.a (along with os.c). In this case
  1001. +  * INLINE will _not_ be set so we can use this to test if we are
  1002. +  * compiling this source file.
  1003. +  */
  1004. + #ifndef INLINE
  1005. + #define INLINE
  1006. + /* Anything required only when compiling */
  1007. + #endif
  1008. + INLINE int os_is_path_absolute(char *file)
  1009. + {
  1010. +     return (strchr(file, ':') || file[0] == '/') ? 1 : 0;
  1011. + }
  1012. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/os/amiga/os.c apache_1.3b3_amiga/src/os/amiga/os.c
  1013. *** apache_1.3b3/src/os/amiga/os.c    Wed Dec 31 19:00:00 1969
  1014. --- apache_1.3b3_amiga/src/os/amiga/os.c    Fri Sep 12 03:28:50 1997
  1015. ***************
  1016. *** 0 ****
  1017. --- 1,6 ----
  1018. + /*
  1019. +  * This file will include OS specific functions which are not inlineable.
  1020. +  * Any inlineable functions should be defined in os-inline.c instead.
  1021. +  */
  1022. + #include "os.h"
  1023. diff --new-file -w -c2 --recursive --exclude-from=NOT apache_1.3b3/src/os/amiga/os.h apache_1.3b3_amiga/src/os/amiga/os.h
  1024. *** apache_1.3b3/src/os/amiga/os.h    Wed Dec 31 19:00:00 1969
  1025. --- apache_1.3b3_amiga/src/os/amiga/os.h    Tue Oct  7 01:53:42 1997
  1026. ***************
  1027. *** 0 ****
  1028. --- 1,20 ----
  1029. + /*
  1030. +  * This file in included in all Apache source code. It contains definitions
  1031. +  * of facilities available on _this_ operating system (HAVE_* macros),
  1032. +  * and prototypes of OS specific functions defined in os.c or os-inline.c
  1033. +  */
  1034. + #if !defined(INLINE) && defined(USE_GNU_INLINE)
  1035. + /* Compiler supports inline, so include the inlineable functions as
  1036. +  * part of the header
  1037. +  */
  1038. + #define INLINE extern ap_inline
  1039. + #include "os-inline.c"
  1040. + #endif
  1041. + #ifndef INLINE
  1042. + /* Compiler does not support inline, so prototype the inlineable functions
  1043. +  * as normal
  1044. +  */
  1045. + extern int os_is_path_absolute(char *f);
  1046. + #endif
  1047. Binary files apache_1.3b3/src/test/zb and apache_1.3b3_amiga/src/test/zb differ
  1048.